﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sentence
{
    class Program
    {
        static void Main(string[] args)
        {
            string S = Console.ReadLine();
            //WriteSFormat(S);
            //ReverseSFormat(L);
            List<string> L = new List<string>(S.Split(new char[] { '.', '(', ')', '?', ':', ';', ',', ' '},StringSplitOptions.RemoveEmptyEntries));
            //PrintList(Mysorting(L.Sort()));
            L.Sort();
            PrintList(L);
            Console.ReadLine();
        }

        static void PrintList(List<string> SS)
        {
            foreach (string s in SS) Console.Write("{0}, ", s);
        }

        public static void WriteSFormat(string S)
        {
            string[] SS = S.Split(new char[] { '.', '(', ')','?',':',';',','}, StringSplitOptions.RemoveEmptyEntries);
            foreach (string s in SS)Console.Write(s.Replace(" ", ", "));
        }

        public static void ReverseSFormat(List<string> L)
        {            
            Stack<string> SS = new Stack<string>(L);
            foreach (string s in SS)
            {
                Console.Write("{0}, ",s);
            }
        }

        public static List<string> Mysorting(List<string> str)
        {
            string key;
            int j;
            for (int i = 1; i < str.Count; i++)
            {
                key = str[i];
                j = i - 1;
                while (j >= 0 && str[j].CompareTo(key) > 0)
                {
                    str[j + 1] = str[j];
                    j--;
                }
                str[j + 1] = key;

            }
            return str;
        }

    }
}
